package com.qf.feigns;

import com.qf.conf.FeignConfig;
import com.qf.pojo.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * 使用这个接口去向qf-order服务发起远程访问
 */
//@RequestMapping("/order") // Feign不支持共性路径抽取

//@FeignClient(value = "QF-ORDER",fallback = OrderApiFallback.class)
@FeignClient(value = "QF-ORDER",fallbackFactory = OrderApiFallbackFactory.class,
        configuration = FeignConfig.class
)
public interface OrderApi {

    @GetMapping("/order/{id}")
    R findByUid(@PathVariable("id") Integer id);
}
